package net.xdclass.controller;

import lombok.extern.slf4j.Slf4j;
import net.xdclass.service.DomainService;
import net.xdclass.util.JsonData;
import net.xdclass.vo.DomainVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/api/domain/v1")
public class DomainController {

    @Autowired
    private DomainService domainService;

    /**
     * 列举全部域名
     * @return
     */
    @GetMapping("list")
    public JsonData listAll(){
        List<DomainVO> domainVOList = domainService.listAll();
        return JsonData.buildSuccess(domainVOList);
    }

}
